<extend name="Public/header"/>
<block name="main">
<body class="bgeee">
    <div class="header-container">
        <div class="weui-cell">
            <div class="weui-cell__hd fs0">
                <img src="__WEBPUBLIC__/Home/img/lefticon.png" class="slimg" />
            </div>
            <div class="weui-cell__bd texcen">
                <p>认证资料</p>
            </div>
        </div>
    </div>
    <div class="xq_container">
        <div class="pad10 colbbb">认证个人资料(已经认证不可修改)</div>
        <div class="weui-cells mat0 uinput ">
            <div class="weui-cell">
                <div class="weui-cell__hd">姓名</div>
                <div class="weui-cell__bd">
                    <input type="text" name="name" class="weui-input name" placeholder="输入姓名" value="{$userinfo['name']}" <if condition="$userinfo['status'] neq 0">readonly</if>>
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd">身份证号</div>
                <div class="weui-cell__bd">
                    <input type="text" name="cardid" class="weui-input cardid" placeholder="输入身份证号" value="{$userinfo['cardid']}" <if condition="$userinfo['status'] neq 0">readonly</if>>
                </div>
            </div>
            
        </div>

        <div class="pad10 colbbb">完善个人信息</div>
        <div class="weui-cells mat0 uinput">
            <div class="weui-cell">
                <div class="weui-cell__hd">行业</div>
                <div class="weui-cell__bd">
                    <input type="text" name="hy" class="weui-input hy" placeholder="输入行业" value="{$userinfo['hy']}">
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd">职业</div>
                <div class="weui-cell__bd">
                    <input type="text" name="zhiw" class="weui-input zhiw" placeholder="输入职业" value="{$userinfo['zhiw']}">
                </div>
            </div>
        </div>
        
        <div class="weui-btn-area">
            <a class="weui-btn bg00f" href="javascript:" id="showTooltips">保存</a>
        </div>

    </div>
</body>
</block>
<block name="footerjs">
	<script>
        $("#showTooltips").on('click',function () {
            var ajadata = {};
            ajadata.hy = $(".hy").val();
            ajadata.zhiw = $(".zhiw").val();
            <if condition="$userinfo['status'] eq 0">
            ajadata.name = $(".name").val();
            ajadata.cardid = $(".cardid").val();
            </if>
            for(var index in ajadata){
                if (!ajadata[index]) {
                    layer.msg("数据不完整！");
                    return;
                }
            }
            requestUrl("{:U('Member/yzinfo')}",ajadata,function ( res ) {
                layer.msg(res.message);
                if (res.flag == "success") {
                    setTimeout(function () {
                        window.location.href = "{:U('Member/self')}";
                    },500);
                }
            })
        });
	</script>
</block>